Optimal. Leaf size=129 \[ \frac {a b \sec ^5(c+d x)}{7 d}+\frac {\sec ^7(c+d x) (b+a \sin (c+d x)) (a+b \sin (c+d x))}{7 d}+\frac {\left (6 a^2-b^2\right ) \tan (c+d x)}{7 d}+\frac {2 \left (6 a^2-b^2\right ) \tan ^3(c+d x)}{21 d}+\frac {\left (6 a^2-b^2\right ) \tan ^5(c+d x)}{35 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.08, antiderivative size = 129, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {2770, 2748,
3852} \begin {gather*} \frac {\left (6 a^2-b^2\right ) \tan ^5(c+d x)}{35 d}+\frac {2 \left (6 a^2-b^2\right ) \tan ^3(c+d x)}{21 d}+\frac {\left (6 a^2-b^2\right ) \tan (c+d x)}{7 d}+\frac {a b \sec ^5(c+d x)}{7 d}+\frac {\sec ^7(c+d x) (a \sin (c+d x)+b) (a+b \sin (c+d x))}{7 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2748
Rule 2770
Rule 3852
Rubi steps
\begin {align*} \int \sec ^8(c+d x) (a+b \sin (c+d x))^2 \, dx &=\frac {\sec ^7(c+d x) (b+a \sin (c+d x)) (a+b \sin (c+d x))}{7 d}-\frac {1}{7} \int \sec ^6(c+d x) \left (-6 a^2+b^2-5 a b \sin (c+d x)\right ) \, dx\\ &=\frac {a b \sec ^5(c+d x)}{7 d}+\frac {\sec ^7(c+d x) (b+a \sin (c+d x)) (a+b \sin (c+d x))}{7 d}-\frac {1}{7} \left (-6 a^2+b^2\right ) \int \sec ^6(c+d x) \, dx\\ &=\frac {a b \sec ^5(c+d x)}{7 d}+\frac {\sec ^7(c+d x) (b+a \sin (c+d x)) (a+b \sin (c+d x))}{7 d}-\frac {\left (6 a^2-b^2\right ) \text {Subst}\left (\int \left (1+2 x^2+x^4\right ) \, dx,x,-\tan (c+d x)\right )}{7 d}\\ &=\frac {a b \sec ^5(c+d x)}{7 d}+\frac {\sec ^7(c+d x) (b+a \sin (c+d x)) (a+b \sin (c+d x))}{7 d}+\frac {\left (6 a^2-b^2\right ) \tan (c+d x)}{7 d}+\frac {2 \left (6 a^2-b^2\right ) \tan ^3(c+d x)}{21 d}+\frac {\left (6 a^2-b^2\right ) \tan ^5(c+d x)}{35 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.84, size = 110, normalized size = 0.85 \begin {gather*} \frac {\sec ^7(c+d x) \left (240 a b+105 \left (2 a^2+b^2\right ) \sin (c+d x)+21 \left (6 a^2-b^2\right ) \sin (3 (c+d x))+42 a^2 \sin (5 (c+d x))-7 b^2 \sin (5 (c+d x))+6 a^2 \sin (7 (c+d x))-b^2 \sin (7 (c+d x))\right )}{840 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.38, size = 120, normalized size = 0.93
method | result | size |
derivativedivides | \(\frac {-a^{2} \left (-\frac {16}{35}-\frac {\left (\sec ^{6}\left (d x +c \right )\right )}{7}-\frac {6 \left (\sec ^{4}\left (d x +c \right )\right )}{35}-\frac {8 \left (\sec ^{2}\left (d x +c \right )\right )}{35}\right ) \tan \left (d x +c \right )+\frac {2 a b}{7 \cos \left (d x +c \right )^{7}}+b^{2} \left (\frac {\sin ^{3}\left (d x +c \right )}{7 \cos \left (d x +c \right )^{7}}+\frac {4 \left (\sin ^{3}\left (d x +c \right )\right )}{35 \cos \left (d x +c \right )^{5}}+\frac {8 \left (\sin ^{3}\left (d x +c \right )\right )}{105 \cos \left (d x +c \right )^{3}}\right )}{d}\) | \(120\) |
default | \(\frac {-a^{2} \left (-\frac {16}{35}-\frac {\left (\sec ^{6}\left (d x +c \right )\right )}{7}-\frac {6 \left (\sec ^{4}\left (d x +c \right )\right )}{35}-\frac {8 \left (\sec ^{2}\left (d x +c \right )\right )}{35}\right ) \tan \left (d x +c \right )+\frac {2 a b}{7 \cos \left (d x +c \right )^{7}}+b^{2} \left (\frac {\sin ^{3}\left (d x +c \right )}{7 \cos \left (d x +c \right )^{7}}+\frac {4 \left (\sin ^{3}\left (d x +c \right )\right )}{35 \cos \left (d x +c \right )^{5}}+\frac {8 \left (\sin ^{3}\left (d x +c \right )\right )}{105 \cos \left (d x +c \right )^{3}}\right )}{d}\) | \(120\) |
risch | \(-\frac {16 i \left (240 i a b \,{\mathrm e}^{7 i \left (d x +c \right )}+70 b^{2} {\mathrm e}^{8 i \left (d x +c \right )}-210 a^{2} {\mathrm e}^{6 i \left (d x +c \right )}-35 b^{2} {\mathrm e}^{6 i \left (d x +c \right )}-126 a^{2} {\mathrm e}^{4 i \left (d x +c \right )}+21 b^{2} {\mathrm e}^{4 i \left (d x +c \right )}-42 a^{2} {\mathrm e}^{2 i \left (d x +c \right )}+7 b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-6 a^{2}+b^{2}\right )}{105 d \left (1+{\mathrm e}^{2 i \left (d x +c \right )}\right )^{7}}\) | \(141\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 97, normalized size = 0.75 \begin {gather*} \frac {3 \, {\left (5 \, \tan \left (d x + c\right )^{7} + 21 \, \tan \left (d x + c\right )^{5} + 35 \, \tan \left (d x + c\right )^{3} + 35 \, \tan \left (d x + c\right )\right )} a^{2} + {\left (15 \, \tan \left (d x + c\right )^{7} + 42 \, \tan \left (d x + c\right )^{5} + 35 \, \tan \left (d x + c\right )^{3}\right )} b^{2} + \frac {30 \, a b}{\cos \left (d x + c\right )^{7}}}{105 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.33, size = 99, normalized size = 0.77 \begin {gather*} \frac {30 \, a b + {\left (8 \, {\left (6 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{6} + 4 \, {\left (6 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{4} + 3 \, {\left (6 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + 15 \, a^{2} + 15 \, b^{2}\right )} \sin \left (d x + c\right )}{105 \, d \cos \left (d x + c\right )^{7}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: SystemError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 260 vs.
\(2 (119) = 238\).
time = 4.88, size = 260, normalized size = 2.02 \begin {gather*} -\frac {2 \, {\left (105 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{13} + 210 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{12} - 210 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{11} + 140 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{11} + 903 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 112 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 1050 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{8} - 636 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 456 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 903 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 112 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 630 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 210 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 140 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 105 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 30 \, a b\right )}}{105 \, {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{7} d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 5.55, size = 135, normalized size = 1.05 \begin {gather*} \frac {\frac {2\,a\,b}{7}+\frac {a^2\,\sin \left (c+d\,x\right )}{7}+\frac {b^2\,\sin \left (c+d\,x\right )}{7}+{\cos \left (c+d\,x\right )}^2\,\left (\frac {6\,a^2\,\sin \left (c+d\,x\right )}{35}-\frac {b^2\,\sin \left (c+d\,x\right )}{35}\right )+{\cos \left (c+d\,x\right )}^4\,\left (\frac {8\,a^2\,\sin \left (c+d\,x\right )}{35}-\frac {4\,b^2\,\sin \left (c+d\,x\right )}{105}\right )+{\cos \left (c+d\,x\right )}^6\,\left (\frac {16\,a^2\,\sin \left (c+d\,x\right )}{35}-\frac {8\,b^2\,\sin \left (c+d\,x\right )}{105}\right )}{d\,{\cos \left (c+d\,x\right )}^7} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________